package com.busibuilding.administrate.area.dao;

import java.util.List;

import com.busibuilding.administrate.area.vo.AreaCVO;
import com.busibuilding.common.dao.CommonDaoImpl;
import com.busibuilding.common.exceptions.DAOException;
import com.busibuilding.common.vo.ICommonVO;
/**
 * Class Name: AreaDAOImpl.java
 * Description: 
 * @author Lin Yanjun
 * @version 1.0
 * @since 1.0
 * Date: 2010-2-25
 */

@SuppressWarnings("unchecked")
public class AreaDAOImpl extends CommonDaoImpl implements AreaDAO {

	@Override
	public int delete(ICommonVO vo) throws DAOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = (Integer)insert(CMD_SQL_MAP_AREA_INSERT, vo);
		return result;
	}
	
	@Override
	public AreaCVO getArea(ICommonVO vo) throws DAOException {
		return (AreaCVO) queryObject(CMD_SQL_MAP_AREA_GET, vo);
	}

	@Override
	public List<AreaCVO> searchAreaByCondition(ICommonVO vo) throws DAOException {
		return queryList(CMD_SQL_MAP_AREA_SEARCH, vo);
	}

	@Override
	public int update(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = update(CMD_SQL_MAP_AREA_UPDATE, vo);
		return result;
	}

	@Override
	public List<AreaCVO> searchAreaByCondition(ICommonVO vo, int skipResults,
			int maxResults) throws DAOException {
		return null;
	}

	@Override
	public int getRecordsCount(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = (Integer)queryObject(CMD_SQL_MAP_AREA_COUNT_RECORDS, vo);
		return result;
	}

}
